#ifndef PARSE_UTIL_H
#define PARSE_UTIL_H

#include <string>
#include <wfrest/HttpServer.h>
//解析工具类
namespace l
{

    class ParseUtil {
    public:
        // 从query中解析出2个key对应的2个val
        static bool parse_query_by_key(const wfrest::HttpReq* req, std::string& val1, std::string& val2, const std::string& key1, const std::string& key2);

        //从application/x-www-form-urlencoded格式的表单中用两个key解析出两个val
        static bool parse_body_on_form_kv(const wfrest::HttpReq* req, std::string& val, const std::string& key);


        //从application/x-www-form-urlencoded格式的表单中用两个key解析出两个val
        static bool parse_body_on_form_kv(const wfrest::HttpReq* req, std::string& val1, std::string& val2, const std::string& key1, const std::string& key2);


    };

}//end of namespace l

#endif